<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>资金记录</title>
		<script src="js/mui.min.js"></script>
		<link href="css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="css/base.css" />
		<script src="js/flexible.js"></script>
		<link rel="stylesheet" href="css/zijinjilu.css" />
		<script src="js/jquery-3.1.1.js"></script>
		<script src="js/confi.js"></script>
		<script src="js/template.js" type="text/javascript" charset="utf-8"></script>

	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a  class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">资金记录</h1>
		</header>
		<table border="" cellspacing="" cellpadding="" style="width: 100%;margin-top: 44px;">
			<thead>
				<tr>
					<th>状态</th>
					<th>金额</th>
					<th>时间</th>
				</tr>
			</thead>
			<tbody id="capital">
				<!--<tr>
					<td>成功</td>
					<td><span>￥</span><span>10.00</span></td>
					<td><span>10-00</span> <span>10:00</span></td>
				</tr>-->
			</tbody>
		</table>
		<!--
    	作者：18291958857@163.com
    	时间：2018-12-07
    	描述：资金记录模板
    -->
		<script type="text/template" id="capitalList">
			{{each items as value index}}
			<tr>
				<td>{{value.status}}</td>
				<td><span>￥</span><span>{{value.amount}}</span></td>
				<td><span>{{value.create_time}}</span></td>
			</tr>
			{{/each}}
		</script>
		<script type="text/javascript" charset="utf-8">
			mui.init();
			//		资金记录
			var token = localStorage.getItem('token');
			mui.ajax(config.host + '/home/User/capitalRecord', {
				headers: {
					'token': token
				},
				dataType: 'json', //服务器返回json格式数据
				type: 'get', //HTTP请求类型	              
				success: function(data) {
					if(data.code == 200) {
						if(data.data.length != 0) {
							var capitalHtml = template('capitalList', {
								"items": data.data
							});
							$('#capital').html(capitalHtml);
						} else {
							$('#capital').html('暂无数据');
							$('#capital').css({
								'height':'50px',
								'line-height':'50px',
								"text-align":'center'
							});
						}

					} else {
						mui.toast(data.msg)
					}
				}
			});
		</script>
	</body>

</html>